<?php defined('IN_IA') or exit('Access Denied');?><?php (!empty($this) && $this instanceof WeModuleSite || 1) ? (include $this->template('common/header', TEMPLATE_INCLUDEPATH)) : (include template('common/header', TEMPLATE_INCLUDEPATH));?>
<style type="text/css">
.red {float:left;color:red}
.white{float:left;color:#fff}
.tooltipbox {
	background:#fef8dd;border:1px solid #c40808; position:absolute; left:0;top:0; text-align:center;height:20px;
	color:#c40808;padding:2px 5px 1px 5px; border-radius:3px;z-index:1000;
}
.red { float:left;color:red}
</style>
<ul class="nav nav-tabs">
    <li class="active"><a href="<?php  echo wurl('profile/module/setting',array('m'=>'hx_o2o'))?>">参数设置</a></li>
</ul>
<div class="main">
	<form action="" method="post" class="form-horizontal form" onsubmit="return returncheck()" enctype="multipart/form-data" id="form1">
		<div class="panel panel-default">
			<div class="panel-heading">
				基础设置
			</div>
			<div class="panel-body">
				<div class="form-group">
					<label class="col-xs-12 col-sm-3 col-md-2 control-label"><span style="color:red">*</span>用户中心点坐标</label>
					<div class="col-sm-9 col-xs-12">
						<?php  echo tpl_form_field_coordinate('location', array('lng' => $settings['shop_lng_baidu'], 'lat' => $settings['shop_lat_baidu']))?>
						<span class="help-block">留空则由小程序通过GPS获取用户的定位</span>
					</div>
				</div>
			</div>
			<div class="panel-body">
                <div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">界面标题</label>
                    <div class="col-sm-9 col-xs-12">
                        <input type="text" name="title" class="form-control" value="<?php  echo $settings['title'];?>" />
                    </div>
                </div>
            </div>
			<div class="form-group">
					<label for="inputEmail3" class="col-sm-2 control-label">图标显示方式</label>
					<div class="col-sm-10">
						<label class="radio radio-inline">
						<input type="radio" name="icon_type" value="1" <?php  if(intval($settings['icon_type']) == 1) { ?>checked="checked"<?php  } ?>>统一图标
						</label>
						<label class="radio radio-inline">
							<input type="radio" name="icon_type" value="0" <?php  if(intval($settings['icon_type']) == 0) { ?>checked="checked"<?php  } ?>>每个标点自定义图标
						</label>
						<span class="help-block">因为小程序的地图不允许设置网络图片作为标点图标，小程序需要将所有点的图标先通过接口下载下来，这里图标多的话有可能会因为下载超时漏掉一些点。选择同一图标不会存在加载问题，但是所有的图标都是一样的了！</span>
					</div>
				</div>
			<div class="form-group">
				<label class="col-xs-12 col-sm-3 col-md-2 col-lg-2 control-label">统一图标logo</label>
				<div class="col-xs-12 col-sm-8">
					<?php  echo tpl_form_field_image('icon', $settings['icon']);?>
					<span class="help-block">该LOGO将作为标记，出现在地图中</span>
				</div>
			</div>
			<div class="panel-body">
                <div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">地图缩放级别</label>
                    <div class="col-sm-9 col-xs-12">
                        <input type="number" name="level" class="form-control" value="<?php  echo $settings['level'];?>" />
						<span class="help-block">输入缩放等级，取值范围5-18，数字越大，地图展示的更详细，默认16</span>
                    </div>
                </div>
            </div>
			<div class="panel-body">
                <div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">最大显示距离</label>
                    <div class="col-sm-9 col-xs-12">
                        <input type="number" name="distance" class="form-control" value="<?php  echo $settings['distance'];?>" />
						<span class="help-block">默认显示中心坐标点周围多少公里内的私塾，填0为不限制</span>
                    </div>
                </div>
            </div>
		</div>

		<div class="form-group col-sm-12">
			<input type="submit" name="submit" value="提交" class="btn btn-primary col-lg-1" />
			<input type="hidden" name="token" value="<?php  echo $_W['token'];?>" />
		</div>
	</form>
</div>
<script>
    function returncheck()
	{
		var icon_type=$('input[name="icon_type"]:checked').val()
		var icon=$('input[name="icon"]').val()
		if(icon_type==1&&icon=="")
		{
			alert("选择统一图标后必须上传logo！");
			return false;
		}
		else
		{
			return true;
		}
		
	}
</script>
<?php (!empty($this) && $this instanceof WeModuleSite || 1) ? (include $this->template('common/footer', TEMPLATE_INCLUDEPATH)) : (include template('common/footer', TEMPLATE_INCLUDEPATH));?>